<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="public/css/style.css" rel="stylesheet" type="text/css">
<title>Fashion Shop TVT</title>
<script type="text/javascript" src="public/js/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="template/slide.js"></script>
</head>
<body>
<div id="wrapper">
    <?php
        //Require your file here
        require_once 'template/pagination.php';
        require_once 'model/works.php';

        //Create global variable
        $md_works = new Works();
        $works = $md_works->select();
        $total = count($works);
        $pagination = new Pagination();

        $page = 1;
        if (isset($_GET['shop'])) {
            $page = $_GET['shop'];
        }
        $works = $md_works->select(null, $page);
        ?>
	<!--TOP HEADER-->
	<?php include 'template/topHeader.php'; ?>
    <!--END TOP HEADER-->
    <!--HEADER-->
    <?php include 'template/header.php'; ?>
  <!--END HEADER-->
  <!--NAV-->
    <?php include 'template/nav.php'; ?>
    <!--END NAV-->
    <!--SLIDE-->
    <?php include 'template/slide.php'; ?>
    <!--END SLIDE-->
    <section>
    	<div id="section">
        	<!--LEFT-->
        	<?php include 'template/colleft.php'; ?>
            <!--END LEFT-->
            <!--RIGHT-->
            <div id="col_right">
            	<div id="tieudes">
                	<table>
                    	<tr>
                        	<td>
                            <img src="public/images/conlai.png">
                            </td>
                            <td>                                                	
                                SẢN PHẨM MỚI NHẤT <img src="public/images/new.gif">
                            </td>
                        </tr>
                    </table>                    
                </div>
                <div id="content">
                        <?php foreach ($works as $work): ?>
                	<div id="content_top">
                    	<div id="h1">
                            <img src="<?php echo $work['image']; ?>">
                            <p class="td">
                            <?php echo $work['name']; ?>
                            </p>
                            <p class="tien">
                            <table class="bang">
                            	<tr>
                                	<td>
                                    	<p class="a">159.000 đ</p>
                                        <p class="b">250.000 đ</p>
                                    </td>
                                    <td><p class="c">
                                    		<a href="#">
                                        	<img src="public/images/xedathang.png">
                                        	<a>
                                    	</p>
                                    </td>
                                    <td><p class="d">
                                    <a href="view.php?id=<?php echo $work['id'] ?>">Chi Tiết</a>
                                    </p></td>
                                </tr>
                          </table>
                            </p>
                        </div>
                       <?php endforeach; ?>
                    </div>
                    <div class="clear"></div>
                    <div id="panigation">
                    	<?php echo $pagination->display($total, $page); ?>
                    </div>                    
                </div>
            </div>
            <!--END RIGHT-->
        </div>
    </section>
    <!--END SECTION-->
     <div class="clear"></div>
     <p>&nbsp;</p>
     <p>&nbsp;</p>
     <p>&nbsp;</p>
     <!--FOOTER-->
     <?php include 'template/footer.php'; ?>
    <!--END FOOTER-->
</div>
</body>
</html>
